<!--********************************************************************
* Copyright© 2000 - 2025 SuperMap Software Co.Ltd. All rights reserved.
*********************************************************************-->
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title data-i18n="resources.text_graduatedSymbol"></title>
    <script type="text/javascript" src="../js/include-web.js"></script>
</head>
<body style=" margin: 0;overflow: hidden;background: #fff;width: 100%;height:100%;position: absolute;top: 0;">
<div id="map" style="margin:0 auto;width: 100%;height: 100%"></div>
<script type="text/javascript" src="../../dist/leaflet/include-leaflet.js"></script>
<script type="text/javascript">
    var host = window.isLocal ? window.server : "https://iserver.supermap.io";
    var map, themeService, themeGraduatedSymbol, themeParameters, themeLayer,
        url = host + "/iserver/services/map-china/rest/maps/China";
    map = L.map('map', {
        center: [39, 100],
        maxZoom: 18,
        zoom: 5
    });
    new L.supermap.TiledMapLayer(url).addTo(map);
    createTheme();

    function createTheme() {
        themeService = new L.supermap.ThemeService(url);
        themeGraduatedSymbol = new L.supermap.ThemeGraduatedSymbol({
            expression: "SmArea",
            baseValue: 3000000000000,
            graduatedMode: L.supermap.GraduatedMode.CONSTANT,
            style: new L.supermap.ThemeGraduatedSymbolStyle({
                positiveStyle: new L.supermap.ServerStyle({
                    markerSize: 50,
                    markerSymbolID: 0,
                    lineColor: new L.supermap.ServerColor(255, 165, 0),
                    fillBackColor: new L.supermap.ServerColor(255, 0, 0)
                })
            })
        });
        themeParameters = new L.supermap.ThemeParameters({
            themes: [themeGraduatedSymbol],
            datasetNames: ["Province_R"],
            dataSourceNames: ["China"]
        });
        themeService.getThemeInfo(themeParameters).then(function (serviceResult) {
            var result = serviceResult.result;
            if (result && result.newResourceID) {
                themeLayer = new L.supermap.TiledMapLayer(url, {
                    cacheEnabled: false,
                    transparent: true,
                    layersID: result.newResourceID
                }).addTo(map);
            }
        });
    }
</script>
</body>
</html>